import request from '@/utils/request'
const api_name = '/video'

export default {
    addVideo(video) {
        return request({
            url: `${api_name}`,
            method: 'post',
            data: video
        })
    },
    //根据id获取课时信息
    getVideoById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'get'
        })
    },
    //更新课时
    undateVideo(video) {
        return request({
            url: `${api_name}/${video.id}`,
            method: 'put',
            data: video
        })
    },
    //删除课时
    deleteById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete',
        })
    }
}